home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6333 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: newsfeed.acns.nwu.edu!ftpbox!mothost!mdisea!pilchuck!news
  3. From: Meiyu Lin <linm@data-io.com>
  4. Subject: Re: Virtual Function in private part?
  5. X-Nntp-Posting-Host: inet-gw
  6. Content-Type: text/plain; charset=us-ascii
  7. Message-ID: <311A6327.188@data-io.com>
  8. Sender: news@data-io.com (Usenet news)
  9. Content-Transfer-Encoding: 7bit
  10. Organization: Data I/O Corp.
  11. References: <4f7s5g$ntt@mcmail.CIS.McMaster.CA>
  12. Mime-Version: 1.0
  13. Date: Thu, 8 Feb 1996 20:55:03 GMT
  14. X-Mailer: Mozilla 2.0b6a (Win95; I)
  15.  
  16. Hong Shen wrote:
  17. > Is there any reasons to make a member function in the private section of
  18. > a class virtual?
  19. > Thanks.
  20. > Hong ShenA virtual function is a special member function invoked through a public 
  21. base class reference or pointer, It's bound dynamically at run time.  
  22. The base class virtual function serves as a kind of placeholder for 
  23. as-yet undertermined derived class types.  Since no one else but the 
  24. class itself can access the private member, so there is no reasons to 
  25. make a member function in the private section of a virtual function.
  26. This is just my "HOP"
  27.  
  28. Happy coding.
  29.  
  30. Meiyu
  31.